package com.itheima.chap04;

public class HmException extends RuntimeException{

    private final int code;

    public HmException(String message, int code) {
        super(message);
        this.code = code;
    }

    // 带异常 cause,防止丢失堆栈信息
    public HmException(String message, Throwable cause, int code) {
        super(message, cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

}
